<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateReportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('reports', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('company_id')->index()->comment('公司ID');
            $table->unsignedInteger('project_id')->index()->comment('项目ID');
			$table->unsignedInteger('station_id')->index()->comment('岗点ID');
			$table->unsignedInteger('user_id')->index()->comment('用户ID');
			$table->unsignedInteger('timing_id')->index()->comment('时间ID');
			$table->string('project_name')->index()->comment('项目名称');
			$table->string('user_name')->comment('报岗人员');
			$table->string('status')->default('')->comment('状态');
			$table->string('address')->nullable()->comment('报岗地址');
			$table->string('example')->comment('示例图编码');
			$table->string('image')->comment('图片地址');
			$table->decimal('longitude', 10, 7)->comment('经度');
			$table->decimal('latitude', 10, 7)->comment('纬度');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('reports');
    }
}
